import request from '@/utils/request'

// 获取全部用户列表
export function getUserList() {
  return request({
    url: '/dispatch/dispatch/dispatchChangeShifts/userList',
    method: 'get'
  })
}

// 获取班次下拉列表
export function getClassesList() {
  return request({
    url: '/dispatch/dispatch/dispatchChangeShifts/classesList',
    method: 'get'
  })
}

// 查询交接班记录列表
export function getDispatchChangeShiftsList(params) {
  return request({
    url: '/dispatch/dispatch/dispatchChangeShifts/list',
    method: 'get',
    params
  })
}

// 获取交接班记录详情
export function getDispatchChangeShiftsDetail(changeShiftsId) {
  return request({
    url: `/dispatch/dispatch/dispatchChangeShifts/${changeShiftsId}`,
    method: 'get'
  })
}

// 新增交接班记录
export function addDispatchChangeShifts(data) {
  return request({
    url: '/dispatch/dispatch/dispatchChangeShifts',
    method: 'post',
    data
  })
}

// 确认接班记录
export function confirmChangeShifts(changeShiftsId) {
  return request({
    url: `/dispatch/dispatch/dispatchChangeShifts/confirm/${changeShiftsId}`,
    method: 'put'
  })
}

// 删除交接班记录
export function deleteDispatchChangeShifts(changeShiftsIds) {
  return request({
    url: `/dispatch/dispatch/dispatchChangeShifts/${changeShiftsIds}`,
    method: 'delete'
  })
}